package com.sg.controller.pbff;

import com.sg.service.biz.pbff.TemplateEngineService;
import com.sg.dto.biz.pbff.req.BffAddSemanticEngineReqDto;
import com.sg.dto.biz.pbff.req.BffQuerySemanticEngineDetailReqDto;
import com.sg.dto.biz.pbff.req.BffQuerySemanticEngineListReqDto;
import com.sg.dto.biz.pbff.req.BffUpdateSemanticEngineReqDto;
import com.sg.dto.biz.pbff.res.BffAddSemanticEngineRespDto;
import com.sg.dto.biz.pbff.res.BffQuerySemanticEngineDetailRespDto;
import com.sg.dto.biz.pbff.res.BffQuerySemanticEngineListRespDto;
import com.sg.dto.biz.pbff.res.BffUpdateSemanticEngineRespDto;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "TemplateEngine", tags = {"TemplateEngine"})
@RestController
// @RequestMapping("/poms/templateEngine/")
public class TemplateEngineController {
    @Autowired
    TemplateEngineService templateEngineService;

    /**
     * B2-8新增语义引擎（平台）
     * gen by moon at 8/10/2022, 3:43:15 AM
     */
    @PostMapping("/oms/platform/templateEngine/addSemanticEngine")
    @ApiOperation(value = "B2-8新增语义引擎（平台）", response = OkrResult.class)
    public OkrResult<BffAddSemanticEngineRespDto> addSemanticEngine(@RequestBody(required = false) @Validated BffAddSemanticEngineReqDto reqDTO) {
        return OkrResult.success(templateEngineService.addSemanticEngine(reqDTO));
    }

    /**
     * B2-8查询语义引擎列表（平台）
     * gen by moon at 10/31/2022, 7:00:47 PM
     */
    @PostMapping("/oms/platform/templateEngine/querySemanticEngineList")
    @ApiOperation(value = "B2-8查询语义引擎列表（平台）", response = OkrResult.class)
    public OkrResult<BffQuerySemanticEngineListRespDto> querySemanticEngineList(@RequestBody(required = false) @Validated BffQuerySemanticEngineListReqDto reqDTO) {
        return OkrResult.success(templateEngineService.querySemanticEngineList(reqDTO));
    }

    /**
     * B2-8查询语义引擎详情
     * gen by moon at 10/28/2022, 11:08:54 PM
     */
    @PostMapping("/oms/platform/templateEngine/querySemanticEngineDetail")
    @ApiOperation(value = "B2-8查询语义引擎详情", response = OkrResult.class)
    public OkrResult<BffQuerySemanticEngineDetailRespDto> querySemanticEngineDetail(@RequestBody(required = false) @Validated BffQuerySemanticEngineDetailReqDto reqDTO) {
        return OkrResult.success(templateEngineService.querySemanticEngineDetail(reqDTO));
    }

    /**
     * B2-8修改语义引擎（平台）
     * gen by moon at 8/17/2022, 8:03:55 PM
     */
    @PostMapping("/oms/platform/templateEngine/updateSemanticEngine")
    @ApiOperation(value = "B2-8修改语义引擎（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateSemanticEngineRespDto> updateSemanticEngine(@RequestBody(required = false) @Validated BffUpdateSemanticEngineReqDto reqDTO) {
        return OkrResult.success(templateEngineService.updateSemanticEngine(reqDTO));
    }

}

